﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IotClientService.Models.Lg;

/// <summary>
/// 打钉机判定条件
/// </summary>
public class LgNailJudge
{
    /// <summary>
    /// 重量的上限值
    /// </summary>
    public double WeightMax { get; set; } = 631.00;
    /// <summary>
    /// 重量的下限值
    /// </summary>
    public double WeightMin { get; set; } = 605.00;
    /// <summary>
    /// 失液量的上限值
    /// </summary>
    public double FluidLossMax { get; set; } = 2.00;
    /// <summary>
    /// 失液量的下限值
    /// </summary>
    public double FluidLossMin { get; set; } = 0.00;
    /// <summary>
    /// 氦气压力值的上限值
    /// </summary>
    public double HeliumPressureMax { get; set; } = -45.0;
    /// <summary>
    /// 氦气压力值的下限值
    /// </summary>
    public double HeliumPressureMin { get; set; } = -55.0;
    /// <summary>
    /// 高度差值的上限值
    /// </summary>
    public double HeightDifferenceMax { get; set; } = 0.20;
    /// <summary>
    /// 高度差值的下限值
    /// </summary>
    public double HeightDifferenceMin { get; set; } = -0.10;
    public override string ToString()
    {
        return $"{WeightMax.ToString("F2").PadLeft(7,'0')}" +
               $"{WeightMin.ToString("F2").PadLeft(7, '0')}" +
               $"{FluidLossMax.ToString("F2").PadLeft(5, '0')}" +
               $"{FluidLossMin.ToString("F2").PadLeft(5, '0')}" +
               $"{HeliumPressureMax.ToString("F1").PadLeft(5, '0')}" +
               $"{HeliumPressureMin.ToString("F1").PadLeft(5, '0')}" +
               $"{HeightDifferenceMax.ToString("F2").PadLeft(5, '0')}" +
               $"{HeightDifferenceMin.ToString("F2").PadLeft(5, '0')}";
    }
}

